from numpy import *
import KNN
import AutoNorm
import TxtToNumpy
import matplotlib.pyplot as plt

def raw_input(str):
    num = input(str)
    return num    

def classifyPerson():
    resultList = ['Not At All', 'In Small Doses', 'In Large Doses']
    
    flyMiles = float(raw_input("Frequent flier miles earned per year: "))
    percentage_of_game_time = float(raw_input("percentage of time spent playing video games: "))
    iceCream = float(raw_input("liters of ice cream consumed per year: "))
    
    dating_data_mat, datingLabels = TxtToNumpy.TxtToNumpy("datingTestSet2.txt")
    norm_data_set, total_difference_value, minValues = AutoNorm.AutoNorm(dating_data_mat)
    
    inArr = array([flyMiles, percentage_of_game_time, iceCream])
    result = KNN.KNN((inArr - minValues) / total_difference_value, norm_data_set, datingLabels, 3)
    print("You will probably like this person: ", resultList[result - 1])
    
classifyPerson()
